﻿using ClientDependency.Core;
using ClientDependency.Core.CompositeFiles;
using NUnit.Framework;

namespace ClientDependency.UnitTests
{
    [TestFixture]
    public class CssMinTest
    {
        [Test]
        public void Ensure_Embedded_Image_Works()
        {
            var cssWithImage = @"body {
    font-size: .85em;
    font-family: 'Trebuchet MS', Verdana, Helvetica, Sans-Serif;
    margin: 0;
    padding: 0;
    color: #696969;
    background: url() repeat;
}";
            var output = CssHelper.MinifyCss(cssWithImage);

            Assert.AreEqual("body{font-size:.85em;font-family:'Trebuchet MS',Verdana,Helvetica,Sans-Serif;margin:0;padding:0;color:#696969;background:url() repeat;}", output);
        }

        /// <summary>
        /// CSSs the transform_ ensure_ element_ with_ id_ selector.
        /// </summary>
        [Test]
        public void CssMin_Ensure_Element_With_Id_Selector()
        {
            //refer to this: http://clientdependency.codeplex.com/workitem/13181

            var css = @"
ol#controls {display:block;    }

table {font-family: Arial;   }
";
            var output = CssHelper.MinifyCss(css);

            Assert.AreEqual("ol#controls{display:block;}table{font-family:Arial;}", output);

        }

    }
}